export class SyncStorageAccess { private _folderCache: { [fullPath: string]: HTMLUListElement; } = {}; private _liCache: { [fullPath: string]: HTMLLIElement; } = {}; constructor(private _root: HTMLUListElement) { byFullPath: storage.PropertiesByFullPath,
timestamp: number): void { read(fullPaths: string[]): storage.PropertiesByFullPath { private _getFolder(fullPath: string, createWhenMissing: boolean): HTMLUListElement { var result = this._folderCache[fullPath];
if (result != null) return result;
result = this._getFolderNotCached(fullPath, createWhenMissing);
this._folderCache[fullPath] = result;
private _getFolderNotCached(fullPath: string, createWhenMissing: boolean): HTMLUListElement { var lastSlashPos = fullPath.lastIndexOf('/'); if (lastSlashPos === 0) { return this._getChildFolder(this._root, fullPath.slice(1), fullPath, createWhenMissing);
var parentPath = fullPath.slice(0, lastSlashPos);
var parent = this._getFolder(parentPath, createWhenMissing);
return this._getChildFolder(parent, fullPath.slice(lastSlashPos + 1), fullPath, createWhenMissing);
private _getChildFolder(parent: HTMLUListElement, folderName: string, fullPath: string, createWhenMissing: boolean): HTMLUListElement { throw new Error('Not implemented.'); private _getChildLI(parent: HTMLUListElement, folderName: string, fullPath: string, createWhenMissing: boolean): HTMLLIElement { for (var i = 0; i < parent.children.length; i++) { var li = parent.children[i];
if (li.tagName.toLowerCase() !== 'li') continue;
private _getEntry(li: HTMLLIElement) {